package com.xy.webadmin.app.model;

import com.baomidou.mybatisplus.annotation.*;
import com.xy.common.core.annotation.*;
import lombok.Data;

import java.util.Date;
import java.util.Map;

/**
 * 教师班级关系实体对象。
 *
 * @author xiaoyue
 * @date 2025-05-13
 */
@Data
@TableName(value = "xy_teacher_clazz")
public class TeacherClazz {

    /**
     * 主键。
     */
    @TableId(value = "id")
    private Long id;

    /**
     * 班级。
     */
    @TableField(value = "clazz_id")
    private Long clazzId;

    /**
     * 教师。
     */
    @TableField(value = "teacher_id")
    private Long teacherId;

    /**
     * 角色。
     */
    @TableField(value = "clazz_role")
    private String clazzRole;

    /**
     * 创建时间。
     */
    @TableField(value = "create_time")
    private Date createTime;

    /**
     * 更新时间。
     */
    @TableField(value = "update_time")
    private Date updateTime;

    /**
     * 创建者。
     */
    @TableField(value = "create_user_id")
    private Long createUserId;

    /**
     * 更新者。
     */
    @TableField(value = "update_user_id")
    private Long updateUserId;

    @RelationDict(
            masterIdField = "clazzId",
            slaveModelClass = Clazz.class,
            slaveIdField = "id",
            slaveNameField = "name")
    @TableField(exist = false)
    private Map<String, Object> clazzIdDictMap;

    @RelationDict(
            masterIdField = "teacherId",
            slaveModelClass = Teacher.class,
            slaveIdField = "id",
            slaveNameField = "name")
    @TableField(exist = false)
    private Map<String, Object> teacherIdDictMap;
}
